package langchain4j.hsl.com.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import langchain4j.hsl.com.model.entity.ChatForm;
import langchain4j.hsl.com.agents.HouAgent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * Created by hsl on 2025/4/25.
 */
@Tag(name = "猴塞雷智能体")
@RestController
@RequestMapping("/hou-agent")
public class HouAgentController {
    @Autowired
    private HouAgent houAgent;

    @PostMapping("/chat")
    public Flux<String> chat(@RequestBody ChatForm chatForm) {
        return houAgent.chat(chatForm.getMemoryId(), chatForm.getMessage());
    }
}
